Skip to content

Conversation

@lukas-principiot
Copy link
Contributor

@lukas-principiot lukas-principiot commented Jan 3, 2026

Adding the PrincipIoT H7 Pi target. I've been in communication with the dev team on Discord and will be sending a sample to Haslinghuis soon.

Two open questions I have (I'm still a bit cloudy on these):

  • Are the ADC DMA options configured correctly?
  • Are the Timer DMA options configured correctly?

Checklist (✓/✕, or y/n)

  • [✓] passed Betaflight team's schematics review
  • [Shipping shortly] passed hardware samples testing
  • [✓] follows guidelines
  • [✓] follows connector standards
  • [Shortly] flight tested
  • comments/issues resolved

Summary by CodeRabbit

  • New Features
    • Added support for the PRINCIPIOTH7PI board with STM32H7 MCU: enables motors/servos, beeper, LED strip, SD card logging, multiple UART ports, I2C/SPI sensors (IMU, barometer, magnetometer), ADC voltage/current sensing, VTX power control and PINIO, RX support, and flexible timer/PWM mappings for peripheral configuration.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 3, 2026

Walkthrough

Adds a new board configuration header for PRINCIPIOTH7PI (STM32H743) declaring MCU/board metadata, extensive pin/peripheral mappings (UART/I2C/SPI/ADC/TIM/DMA), sensor selections (IMU/baro/mag), SD/blackbox settings, LED/PINIO/VTX controls, and related macros.

Changes

Cohort / File(s) Summary
New PRINCIPIOTH7PI board configuration
configs/PRINCIPIOTH7PI/config.h
New comprehensive board header introducing FC_TARGET_MCU, BOARD_NAME, MANUFACTURER_ID, UART/I2C/SPI and DMA mappings, ADC channels, timer-to-pin mappings, sensor (IMU/baro/mag) enables and alignment, SD/blackbox settings, LED and PINIO/VTX definitions, and various hardware enable macros.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

Schematics approved, Uses BF connector standard, Awaiting prototype samples

Suggested reviewers

  • haslinghuis
  • ot0tot
  • nerdCopter

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: adding a new target configuration for the PrincipIoT H7 Pi board.
Description check ✅ Passed The description covers most required sections with checklist items marked, though some items indicate pending status (hardware samples, flight testing) and one required section (comments/issues resolved) remains unchecked.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 76c2c19 and 90aead9.

📒 Files selected for processing (1)
  • configs/PRINCIPIOTH7PI/config.h
🧰 Additional context used
🧠 Learnings (35)
📓 Common learnings
Learnt from: haslinghuis
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-30T20:09:11.644Z
Learning: For Betaflight board configuration reviews, maintainer information must be included in target submissions according to the Requirements for Submission of New and Updated Targets.
Learnt from: haslinghuis
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-30T20:09:11.644Z
Learning: For Betaflight board configuration reviews, F411 MCU, SPI-based RX, and BMI270 gyro are deprecated platforms as of September 16, 2024. New target submissions using these should be flagged.
Learnt from: haslinghuis
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-30T20:09:11.644Z
Learning: For Betaflight board configuration reviews, schematics are mandatory for all new target submissions. Submissions without schematics for review should be rejected according to the Config Target Guidance.
Learnt from: osirisinferi
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-30T21:03:53.169Z
Learning: For Betaflight board configuration reviews, schematics are mandatory for the overall review process according to the Config Target Guidance, but they do NOT need to be provided publicly in the GitHub PR itself. Schematics review is conducted through a separate/private channel. Do not flag "missing schematics in PR" as a blocking issue.
Learnt from: haslinghuis
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-30T20:09:11.644Z
Learning: For Betaflight board configuration reviews, commercial target submissions require payment of a target fee. This should be verified as part of the submission requirements.
Learnt from: haslinghuis
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-30T20:09:11.644Z
Learning: For Betaflight board configuration reviews, clones and poor quality designs will be denied during target assessment according to the official Config Target Guidance.
Learnt from: osirisinferi
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-27T17:15:05.111Z
Learning: For Betaflight board configuration reviews, when analyzing TIMER_PIN_MAPPING definitions in config.h files, perform a comprehensive verification by: (1) Clone or access the betaflight/betaflight repository and look up each pin's timer definitions from the appropriate timer_stm32*.c file (e.g., timer_stm32h7xx.c for STM32H743, timer_stm32f4xx.c for STM32F405, etc.). (2) For each TIMER_PIN_MAP entry, verify that the timer occurrence index specified actually exists in the timer definition file for that pin. Non-existent occurrences will cause build or runtime errors. (3) Check if any timer occurrence being used is a complementary channel (ending in "N" like TIM1_CH2N, TIM8_CH3N). Complementary channels are not suitable for motor/servo control and must not be actively selected. (4) Verify that each timer channel uses a unique DMA index on MCUs with DMAMUX (like STM32H7). For MCUs without DMAMUX (like STM32F4/F7), verify non-conflicting DMA stream requests according to the appropriate DMA r...
Learnt from: haslinghuis
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-30T20:09:11.644Z
Learning: For Betaflight board configuration reviews, STM32 F4 and F7 based designs with more than 4 motor outputs are not accepted for new submissions after December 3, 2024. This is an official timeline restriction from the Config Target Guidance.
Learnt from: haslinghuis
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-30T20:17:04.545Z
Learning: For Betaflight board configuration reviews, hardware design must follow the Manufacturer Design Guidelines: proper power regulation with good ground/power planes and decoupling, redundant solder pads or castellations for durability, oversized mounting holes for M3 stack robustness, clear silkscreen pin labels and revision marking, and high-speed signals routed away from noisy power traces.
Learnt from: haslinghuis
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-30T20:09:11.644Z
Learning: For Betaflight board configuration reviews, the manufacturer must be registered in the Manufacturers.md file. Always verify that the MANUFACTURER_ID in config.h has a corresponding entry in Manufacturers.md.
Learnt from: haslinghuis
Repo: betaflight/config PR: 835
File: configs/HDZERO_HALO_MPU6000/config.h:44-56
Timestamp: 2025-07-14T16:16:56.822Z
Learning: For Betaflight board configurations of boards already in production, pin assignments in config.h files reflect the actual hardware design and cannot be changed, even if they present potential conflicts with debug interfaces. The configuration must match the physical board layout, not ideal software design preferences.
Learnt from: ot0tot
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-07-03T04:33:57.480Z
Learning: Always verify that the BOARD_NAME define in each config.h matches the directory name it resides in (e.g., configs/AXISFLYINGF7AIO/config.h must have #define BOARD_NAME AXISFLYINGF7AIO). This check is required for all Betaflight board configuration reviews.
Learnt from: ot0tot
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-07-03T04:33:57.480Z
Learning: Always verify that the `BOARD_NAME` define in config.h files exactly matches the directory name where the config file is located. For example, if the config file is in configs/AXISFLYINGF7AIO/config.h, then the BOARD_NAME should be defined as "AXISFLYINGF7AIO". This ensures proper board identification and configuration loading in Betaflight.
Learnt from: haslinghuis
Repo: betaflight/config PR: 888
File: configs/ZEX_ATHENA_MINI/config.h:0-0
Timestamp: 2025-08-28T20:45:36.652Z
Learning: In STM32H743 Betaflight configurations, PA15 maps to TIM2_CH1 (timer index 2) as defined in timer_stm32h7xx.c. When used for GYRO_CLKIN functionality, it's recommended to use the macro name GYRO_1_CLKIN_PIN in TIMER_PIN_MAPPING for consistency with other pin definitions.
Learnt from: haslinghuis
Repo: betaflight/config PR: 879
File: configs/AIRBOTSUPERF4V2/config.h:42-45
Timestamp: 2025-08-22T17:08:23.283Z
Learning: In Betaflight board configurations, OSD feature flags like USE_OSD_SD (analog/MAX7456) and USE_OSD_HD (digital/MSP DisplayPort) are typically defined at build time by the build system, not in the individual board config.h files. Board configs can conditionally define OSD-related settings based on these build-time flags.
Learnt from: ot0tot
Repo: betaflight/config PR: 872
File: configs/HGLRCH743/config.h:82-83
Timestamp: 2025-08-20T02:54:58.596Z
Learning: For Betaflight board configuration reviews, the definitive source for validating UART pin assignments is the serial_uart_{platform}.c file in the Betaflight codebase (e.g., serial_uart_stm32h7xx.c for STM32H7xx platforms), not generic MCU datasheets. These files contain the exact pin mappings that Betaflight supports for each UART peripheral.
Learnt from: haslinghuis
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-30T20:17:04.545Z
Learning: For Betaflight board configuration reviews, documentation requirements include: published schematics/KiCad files, SWD programming pads or header following the SWD pin mapping specification, connector pinouts, and clear board revision notes so Betaflight Configurator can link board documentation according to the Manufacturer Design Guidelines.
📚 Learning: 2025-07-03T04:33:57.480Z
Learnt from: ot0tot
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-07-03T04:33:57.480Z
Learning: Always verify that the BOARD_NAME define in each config.h matches the directory name it resides in (e.g., configs/AXISFLYINGF7AIO/config.h must have #define BOARD_NAME AXISFLYINGF7AIO). This check is required for all Betaflight board configuration reviews.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-07-14T16:16:56.822Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 835
File: configs/HDZERO_HALO_MPU6000/config.h:44-56
Timestamp: 2025-07-14T16:16:56.822Z
Learning: For Betaflight board configurations of boards already in production, pin assignments in config.h files reflect the actual hardware design and cannot be changed, even if they present potential conflicts with debug interfaces. The configuration must match the physical board layout, not ideal software design preferences.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-07-03T04:33:57.480Z
Learnt from: ot0tot
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-07-03T04:33:57.480Z
Learning: Always verify that the `BOARD_NAME` define in config.h files exactly matches the directory name where the config file is located. For example, if the config file is in configs/AXISFLYINGF7AIO/config.h, then the BOARD_NAME should be defined as "AXISFLYINGF7AIO". This ensures proper board identification and configuration loading in Betaflight.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-12-27T17:15:05.111Z
Learnt from: osirisinferi
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-27T17:15:05.111Z
Learning: For Betaflight board configuration reviews, when analyzing TIMER_PIN_MAPPING definitions in config.h files, perform a comprehensive verification by: (1) Clone or access the betaflight/betaflight repository and look up each pin's timer definitions from the appropriate timer_stm32*.c file (e.g., timer_stm32h7xx.c for STM32H743, timer_stm32f4xx.c for STM32F405, etc.). (2) For each TIMER_PIN_MAP entry, verify that the timer occurrence index specified actually exists in the timer definition file for that pin. Non-existent occurrences will cause build or runtime errors. (3) Check if any timer occurrence being used is a complementary channel (ending in "N" like TIM1_CH2N, TIM8_CH3N). Complementary channels are not suitable for motor/servo control and must not be actively selected. (4) Verify that each timer channel uses a unique DMA index on MCUs with DMAMUX (like STM32H7). For MCUs without DMAMUX (like STM32F4/F7), verify non-conflicting DMA stream requests according to the appropriate DMA r...

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-12-30T20:09:11.644Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-30T20:09:11.644Z
Learning: For Betaflight board configuration reviews, maintainer information must be included in target submissions according to the Requirements for Submission of New and Updated Targets.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-12-30T20:09:11.644Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-30T20:09:11.644Z
Learning: For Betaflight board configuration reviews, the manufacturer must be registered in the Manufacturers.md file. Always verify that the MANUFACTURER_ID in config.h has a corresponding entry in Manufacturers.md.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-12-30T20:09:11.644Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-30T20:09:11.644Z
Learning: For Betaflight board configuration reviews, F411 MCU, SPI-based RX, and BMI270 gyro are deprecated platforms as of September 16, 2024. New target submissions using these should be flagged.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-12-30T20:09:11.644Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-30T20:09:11.644Z
Learning: For Betaflight board configuration reviews, STM32 F4 and F7 based designs with more than 4 motor outputs are not accepted for new submissions after December 3, 2024. This is an official timeline restriction from the Config Target Guidance.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-12-30T20:09:11.644Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-30T20:09:11.644Z
Learning: For Betaflight board configuration reviews, schematics are mandatory for all new target submissions. Submissions without schematics for review should be rejected according to the Config Target Guidance.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-06-23T18:43:31.746Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 822
File: configs/AXISFLYINGH7MINI/config.h:29-37
Timestamp: 2025-06-23T18:43:31.746Z
Learning: In Betaflight configuration files, feature enablement macros like USE_MAG are build options that can be controlled at compile time, while hardware instance definitions like MAG_I2C_INSTANCE are predefined in board configurations to assist with hardware mapping when those features are enabled at build time.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-12-27T17:04:49.273Z
Learnt from: osirisinferi
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-27T17:04:49.273Z
Learning: For STM32H743 and other MCUs with DMAMUX in Betaflight, LED_STRIP_PIN must have a valid DMA index in TIMER_PIN_MAPPING (not -1) because WS2812/addressable LEDs require DMA for precise timing control. Using DMA -1 for LED strip will cause the feature to be non-functional.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-12-27T16:56:51.341Z
Learnt from: osirisinferi
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-27T16:56:51.341Z
Learning: In TIMER_PIN_MAPPING definitions for STM32H743, even though the chip has DMAMUX, each timer channel must still use a unique DMA index to avoid resource conflicts. Using the same DMA index (e.g., 0) for multiple timer channels will cause DMA conflicts. Proper H743 configurations use sequential or varied DMA indices (e.g., 0, 1, 2, 3, 4, 5, 6, 7, etc.) with -1 reserved for special pins without DMA like camera control or gyro clock input.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-12-27T16:50:57.069Z
Learnt from: osirisinferi
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-27T16:50:57.069Z
Learning: In TIMER_PIN_MAPPING definitions, each timer channel must have a unique DMA index. Multiple entries using the same timer (e.g., timer 1 or timer 2) with the same DMA index (e.g., 0) will cause DMA conflicts. Proper configurations use sequential or varied DMA indices to avoid resource conflicts between motors, servos, and other peripherals.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-07-14T15:41:14.364Z
Learnt from: ot0tot
Repo: betaflight/config PR: 834
File: configs/RADIOLINKF405/config.h:79-88
Timestamp: 2025-07-14T15:41:14.364Z
Learning: In STM32F405 configurations, PB1 typically maps to TIM3_CH4 and PC9 typically maps to TIM8_CH4. These are different timers and do not share DMA resources, so there is no conflict when both pins are used simultaneously (e.g., PB1 for LED_STRIP and PC9 for MOTOR4).

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-06-02T16:16:20.197Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-06-02T16:16:20.197Z
Learning: In STM32F405-based flight controller configurations, timer pin mappings must be carefully analyzed for DMA stream conflicts, especially between motor timers, LED strip timers, and SPI DMA assignments. Changes to TIMER_PIN_MAPPING should include verification that all required peripherals (motors, LED strip, blackbox SPI) can coexist without DMA conflicts.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-06-02T16:16:20.197Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-06-02T16:16:20.197Z
Learning: For Betaflight configurations, blackbox logging via SPI3 and LED_STRIP functionality can be mutually exclusive due to DMA stream conflicts on STM32F4 targets. This hardware limitation should be identified during timer configuration reviews.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-12-30T20:23:04.046Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-30T20:23:04.046Z
Learning: For Betaflight board configuration reviews on STM32F7/H7/G4/AT32F435 MCUs, bitbanged DShot is preferred because DMAMUX avoids many DMA conflicts. Bitbanged DShot always uses TIM1 and/or TIM8, so at least one of those timers must be available for motor control.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-12-30T20:23:04.046Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-30T20:23:04.046Z
Learning: For Betaflight board configuration reviews, TIM1 and TIM8 are "advanced" timers used by DShot bitbang and can drive any GPIO in bitbang mode. Do not assign TIM1/TIM8 to other critical functions when bitbanged DShot is expected, as this will create resource conflicts.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-12-30T20:23:04.046Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-30T20:23:04.046Z
Learning: For Betaflight board configuration reviews on STM32F4, prefer PWM-based DShot by default due to DMA2/SPI1 limitations and errata. Bitbanged DShot uses DMA2 and TIM1/TIM8 which conflicts with SPI1 (gyro) DMA. Avoid using TIM1/TIM8 for other functions on F4 if bitbanged DShot is needed.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-12-30T20:23:04.046Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-30T20:23:04.046Z
Learning: For Betaflight board configuration reviews, motor channels must be prioritized above all other peripherals when assigning timers/DMA according to section 3.2 of the Manufacturer Design Guidelines. Designs that cannot allocate sufficient timer/DMA resources for motors/DShot will be rejected.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-09-01T19:58:52.049Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 881
File: configs/GEPRC_TAKER_H743MINI/config.h:86-99
Timestamp: 2025-09-01T19:58:52.049Z
Learning: For STM32H743 PB0 in Betaflight, there are three timer options: TIM1_CH2N, TIM3_CH3, and TIM8_CH2N. Only TIM3_CH3 (timer index 2) is suitable for GYRO_CLKIN as the other two are complementary (N) channels. This is confirmed in timer_stm32h7xx.c.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-07-25T20:06:07.492Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 719
File: configs/SPEDIXG473/config.h:29-38
Timestamp: 2025-07-25T20:06:07.492Z
Learning: BMP280 and DPS310 barometer drivers in Betaflight do not require USE_I2C to be explicitly defined in board configurations. Many existing boards successfully use USE_BARO_BMP280 and USE_BARO_DPS310 without defining USE_I2C, indicating that the I2C dependency is handled automatically by the build system or these sensors support alternative communication methods.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-07-25T20:06:07.492Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 719
File: configs/SPEDIXG473/config.h:29-38
Timestamp: 2025-07-25T20:06:07.492Z
Learning: BMP280 and DPS310 barometer drivers in Betaflight do not require USE_I2C to be explicitly defined in board configurations. Out of 264 boards using these drivers, 259 (98%) work without USE_I2C defined, indicating that the I2C dependency is handled automatically by the build system.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-05-28T15:42:05.402Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 792
File: configs/BEEROTORF4/config.h:30-30
Timestamp: 2025-05-28T15:42:05.402Z
Learning: The DEFAULT_GYRO_ENABLED macro with both gyros enabled (GYRO_MASK(0) | GYRO_MASK(1)) should only be added to board configurations that have DEFAULT_GYRO_TO_USE set to GYRO_CONFIG_USE_GYRO_BOTH. Boards without this setting should only get the GYRO_COUNT definition.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-05-28T15:42:05.402Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 792
File: configs/BEEROTORF4/config.h:30-30
Timestamp: 2025-05-28T15:42:05.402Z
Learning: The DEFAULT_GYRO_ENABLED macro with both gyros enabled (GYRO_MASK(0) | GYRO_MASK(1)) should only be added to board configurations that have DEFAULT_GYRO_TO_USE set to GYRO_CONFIG_USE_GYRO_BOTH. Boards without this setting should only get the GYRO_COUNT definition to specify the number of available gyros.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-12-03T20:50:01.374Z
Learnt from: osirisinferi
Repo: betaflight/config PR: 972
File: configs/AXISFLYING_H743PRO/config.h:98-98
Timestamp: 2025-12-03T20:50:01.374Z
Learning: In Betaflight board configurations, if PINIOx_BOX or PINIOx_CONFIG defines are present in a config.h file, the corresponding PINIOx_PIN define must also be present to specify the actual pin assignment. Each PINIO instance requires a pin definition before it can be configured or assigned to a box.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-07-14T15:38:06.837Z
Learnt from: ot0tot
Repo: betaflight/config PR: 834
File: configs/RADIOLINKF405/config.h:52-53
Timestamp: 2025-07-14T15:38:06.837Z
Learning: In Betaflight flight controller configurations, it's common and intentional for UART2_RX_PIN and RX_PPM_PIN to share the same GPIO pin (like PA3) because they represent mutually exclusive receiver input protocols. The pin can be configured for either serial receiver input (UART2) or PPM input, but not both simultaneously. This is a standard design pattern in flight controller hardware.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-08-26T14:26:11.863Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 883
File: configs/HGLRCF435_AIO/config.h:50-58
Timestamp: 2025-08-26T14:26:11.863Z
Learning: For AT32F435 in Betaflight, UART4 supports multiple pin options including PH2 (UART4_RX) and PH3 (UART4_TX) with GPIO_MUX_8, as confirmed in the official Betaflight codebase at src/platform/AT32/serial_uart_at32f43x.c. The AT32 platform has broader pin support than initially apparent from basic searches.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-12-30T20:33:02.562Z
Learnt from: osirisinferi
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-30T20:33:02.562Z
Learning: For Betaflight board configuration reviews, PC13, PC14, and PC15 must never be used for status LED pins (LED0_PIN, LED1_PIN, LED2_PIN, etc.) because these pins are on the STM32 RTC/backup domain with severely limited current drive capability (~3mA max) and cannot directly drive LED indicators. However, LED_STRIP_PIN is permitted on these pins since it only outputs digital timing signals to addressable LED controllers and does not directly sink or source significant current.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-08-20T02:54:58.596Z
Learnt from: ot0tot
Repo: betaflight/config PR: 872
File: configs/HGLRCH743/config.h:82-83
Timestamp: 2025-08-20T02:54:58.596Z
Learning: For Betaflight board configuration reviews, the definitive source for validating UART pin assignments is the serial_uart_{platform}.c file in the Betaflight codebase (e.g., serial_uart_stm32h7xx.c for STM32H7xx platforms), not generic MCU datasheets. These files contain the exact pin mappings that Betaflight supports for each UART peripheral.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-08-28T20:45:36.652Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 888
File: configs/ZEX_ATHENA_MINI/config.h:0-0
Timestamp: 2025-08-28T20:45:36.652Z
Learning: In STM32H743 Betaflight configurations, PA15 maps to TIM2_CH1 (timer index 2) as defined in timer_stm32h7xx.c. When used for GYRO_CLKIN functionality, it's recommended to use the macro name GYRO_1_CLKIN_PIN in TIMER_PIN_MAPPING for consistency with other pin definitions.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-12-27T16:50:57.069Z
Learnt from: osirisinferi
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-27T16:50:57.069Z
Learning: In Betaflight board configurations, when GYRO_1_CLKIN_PIN (or GYRO_2_CLKIN_PIN) is defined, it must be included in the TIMER_PIN_MAPPING with appropriate timer and DMA settings, typically with DMA index -1. Check similar boards from the same manufacturer for the correct pattern.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-08-28T20:45:36.652Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 888
File: configs/ZEX_ATHENA_MINI/config.h:0-0
Timestamp: 2025-08-28T20:45:36.652Z
Learning: In STM32H743 Betaflight configurations, PB0 can use multiple timer options including TIM1_CH2N, TIM3_CH3, and TIM8_CH2N as defined in timer_stm32h7xx.c. For CAMERA_CONTROL_PIN assignments, TIM3_CH3 (timer index 3) is the appropriate choice.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
📚 Learning: 2025-07-23T13:43:50.456Z
Learnt from: ot0tot
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-07-23T13:43:50.456Z
Learning: For Betaflight board configuration reviews, always verify that serial port defines (like ESC_SENSOR_UART, MSP_UART, GPS_UART, etc.) use valid SERIAL_PORT identifiers that match those defined in the Betaflight codebase at src/main/io/serial.h. Common valid identifiers include SERIAL_PORT_USART1, SERIAL_PORT_USART2, SERIAL_PORT_USART3, SERIAL_PORT_UART4, SERIAL_PORT_UART5, etc. Invalid identifiers like SERIAL_PORT_UART3 (should be SERIAL_PORT_USART3) will cause build failures.

Applied to files:

  • configs/PRINCIPIOTH7PI/config.h
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Process Target PRINCIPIOTH7PI
🔇 Additional comments (6)
configs/PRINCIPIOTH7PI/config.h (6)

107-108: ADC DMA options configured correctly.

The ADC DMA options use unique indices (9 and 10) that don't conflict with motor timer DMA (0-7), LED strip (8), or TIMUP DMA (11-12). This configuration is correct for STM32H743 with DMAMUX.

This addresses your question about ADC DMA options being configured correctly.


189-190: Timer DMA options configured correctly.

The TIMUP DMA options use unique indices (11 and 12) that don't conflict with motor timer DMA (0-7), LED strip (8), or ADC DMA (9-10). TIMUP3 and TIMUP5 correspond to the motor timers (TIM3 and TIM5) used in this configuration. While TIMUP DMA may overlap with motor timer DMA indices in some cases (since they're not used simultaneously), using unique indices here is the safer approach.

This addresses your question about Timer DMA options being configured correctly.


193-206: RX, GPS, and PINIO configuration looks good.

The serial port assignments use valid identifiers (SERIAL_PORT_USART8, SERIAL_PORT_UART4), and the PINIO configuration is correct with:

  • PINIO1 mapped to USER1 (box 40) for VTX power control
  • PINIO2 mapped to USER2 (box 41) for general use

All PINIO instances have corresponding pin definitions as required.


27-27: MANUFACTURER_ID is properly registered.

The manufacturer ID "PRIN" (PrincipIoT LLC) is correctly registered in Manufacturers.md at line 108.


43-64: UART pin assignments verified as valid for STM32H743.

All six UART configurations are supported by the Betaflight codebase:

  • UART2 (PD5/PD6): Valid per USART2 definition
  • UART3 (PD8/PD9): Valid per USART3 definition
  • UART4 (PB9/PB8): Valid per UART4 definition
  • UART6 (PC6/PC7): Valid per USART6 definition
  • UART7 (PE8/PE7): Valid per UART7 definition
  • UART8 (PE1/PE0): Valid per UART8 definition

177-187: No issues found with TIMER_PIN_MAPPING configuration.

Cross-reference with five similar STM32H743 boards (ACROSKYH743, AOCODARCH7DUAL, BETAFPVH743, BROTHERHOBBYH743, AXISFLYINGH743PRO) confirms:

  • Timer occurrence indices match established patterns for this MCU
  • All DMA indices are unique (0–8) with -1 reserved for beeper
  • LED_STRIP_PIN (PA8) has valid DMA index 8, required for DMAMUX platforms
  • No duplicate pins in TIMER_PIN_MAPPING
  • No GYRO_CLKIN_PIN conflicts (not defined)
  • Motor channels prioritized with sequential low DMA indices

Configuration is valid and complete.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

lukas-principiot and others added 3 commits January 3, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants